package com.qingjiang.projectschedule.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qingjiang.projectschedule.pojo.Role;
import com.qingjiang.projectschedule.service.RoleService;
import com.qingjiang.projectschedule.mapper.RoleMapper;
import com.qingjiang.projectschedule.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author jx
* @description 针对表【role】的数据库操作Service实现
* @createDate 2024-03-20 10:10:05
*/
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role>
    implements RoleService{
    @Autowired
    private RoleMapper roleMapper;
    @Override
    public Role getRoleById(Integer roleid) {
        Role role = roleMapper.selectById(roleid);
        return role;
    }

    @Override
    public Result getRoleList() {
        List<Role> roles = roleMapper.selectList(null);
        return Result.ok(roles);
    }
}




